package com.cloud.file.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @packageName: com.cloud.file.config
 * @name: WebConfig
 * @description:
 * @author: 董定卓
 * @dateTime: 2019/6/14 11:38
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {


    @Value("${file.path}")
    String filePath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/fp/**").addResourceLocations("file:///" + filePath + "/");
    }
}
